package com.iocup.keybastion.authorize.decision;


import com.iocup.keybastion.authorize.element.AuthElement;
import com.iocup.keybastion.context.WebContextHolder;
import com.iocup.keybastion.utils.AuthUtils;

import java.util.List;

/**
 * @Description: 用户是否登录
 * @Author: xyjxust
 * @Date: 2022/3/22 13:49
 */
public class RequiresUserDecision implements AuthDecision {
    @Override
    public boolean decide(List<AuthElement> list, WebContextHolder webContext) {
        return AuthUtils.isLogin();
    }

    @Override
    public String getType() {
        return DecisionType.requiresUser.name();
    }
}
